/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * ListadoEnfermedades.java
 *
 * Created on 28-may-2012, 15:18:35
 */
package triaje;

import java.util.List;
import javax.swing.DefaultListModel;
import javax.swing.JList;

/**
 *
 * @author Usuario
 */
public class ListadoEnfermedades extends javax.swing.JFrame {

    
    JLista lista = new JLista();
    SintomasAsociados sa = new SintomasAsociados();
    /** Creates new form ListadoEnfermedades */
    public ListadoEnfermedades() {
        initComponents();
        //llenar el JList de la nueva ventana
                
                
                lista.LlenarModelEmisor(sa.asociaciones);
                
                jlemisora.setModel(lista.modelEmisor);
                jlreceptora.setModel(lista.modelReceptor);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        bagregar = new javax.swing.JButton();
        bquitar = new javax.swing.JButton();
        jScrollPane1 = new javax.swing.JScrollPane();
        jlreceptora = new javax.swing.JList();
        jScrollPane2 = new javax.swing.JScrollPane();
        jlemisora = new javax.swing.JList();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);

        bagregar.setText(">>");
        bagregar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bagregarActionPerformed(evt);
            }
        });

        bquitar.setText("<<");
        bquitar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bquitarActionPerformed(evt);
            }
        });

        jScrollPane1.setViewportView(jlreceptora);

        jlemisora.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jlemisoraMouseClicked(evt);
            }
        });
        jScrollPane2.setViewportView(jlemisora);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(26, 26, 26)
                .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 328, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(bagregar)
                    .addComponent(bquitar))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 328, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(105, 105, 105)
                        .addComponent(bagregar)
                        .addGap(18, 18, 18)
                        .addComponent(bquitar))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(24, 24, 24)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 265, Short.MAX_VALUE)
                            .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 265, Short.MAX_VALUE))))
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

private void bagregarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bagregarActionPerformed
// TODO add your handling code here:
    DefaultListModel modelito2 = lista.EmisortoReceptor(jlemisora, jlreceptora);
    jlemisora.setModel(modelito2);
}//GEN-LAST:event_bagregarActionPerformed

private void jlemisoraMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jlemisoraMouseClicked
// TODO add your handling code here:
}//GEN-LAST:event_jlemisoraMouseClicked

private void bquitarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bquitarActionPerformed
// TODO add your handling code here:
    DefaultListModel modelito2 = lista.ReceptortoEmisor(jlemisora, jlreceptora);
    jlreceptora.setModel(modelito2);
}//GEN-LAST:event_bquitarActionPerformed

    
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton bagregar;
    private javax.swing.JButton bquitar;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    public javax.swing.JList jlemisora;
    public javax.swing.JList jlreceptora;
    // End of variables declaration//GEN-END:variables
}
